package com.smooth.mall.exception;

public enum SmoothMallExceptionEnum {

    NEED_USER_NAME(10001,"用户名不能为空"),
    NEED_PASSWORD(10002,"密码不能为空"),
    SYSTEM_ERROR(10003,"系统异常"),
    PASSWORD_TOO_SHORT(10003, "密码长度不能小于8位"),
    USER_EXISTED(10004,"用户已经存在"),
//    NAME_EXISTED(10004, "不允许重名，注册失败"),
    NAME_EXISTED(10004, "不允许重名"),//修改
    INSERT_FAILED(10005,"插入用户失败"),
    WRONG_PASSWORD(10006, "密码错误"),
    PASSWORD_TOO_LONG_OR_SHORT(10006,"密码长度小于8或者大于16"),
    NEED_LOGIN( 10007, "需要登录后继续操作"),
    UPDATE_FAILED(10008, "更新失败"),
    PARA_NOT_NULL(10009, "商品不存在"),//未修改
    NEED_ADMIN(10009, "需要管理员权限"),
    CREATE_FALIED(10011, "新增失败"),
    REQUEST_PARAM_ERROR(10012, "参数错误"),
    DELETE_FAILED(10013, "删除失败"),
    MKDIR_FAILED(10014, "上传图片失败"),
    UPLOAD_FAILED(10015, "图片加载失败"),
    NOT_SALE(10016, "商品状态不可售"),
    NOT_ENOUGH(10017,"商品库存不足"),
    CART_SELECTED_EMPTY(10018,"未选择购物车"),
    NO_ENUM(10029,"无相关订单状态"),
    NO_ORDER(10020,"未选择购物车"),
    NO_YOURORDER(10021,"你未选择购物车"),
    EXCEPTION_ORDER(10022,"订单异常，取消失败"),
    WRONG_ORDER(10023,"当前订单状态异常"),
    ;

    //异常编码
    private Integer code;
    //异常描述信息
    private String msg;

    SmoothMallExceptionEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
